<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: Spec::Example::ExampleMethods</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">Spec::Example::ExampleMethods</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/rspec/lib/spec/example/example_methods_rb.html">
                vendor/plugins/rspec/lib/spec/example/example_methods.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000332">__full_description</a>&nbsp;&nbsp;
      <a href="#M000337">after_example</a>&nbsp;&nbsp;
      <a href="#M000336">before_example</a>&nbsp;&nbsp;
      <a href="#M000331">description</a>&nbsp;&nbsp;
      <a href="#M000334">eval_block</a>&nbsp;&nbsp;
      <a href="#M000328">execute</a>&nbsp;&nbsp;
      <a href="#M000335">implementation_backtrace</a>&nbsp;&nbsp;
      <a href="#M000329">instance_variable_hash</a>&nbsp;&nbsp;
      <a href="#M000333">set_instance_variables_from_hash</a>&nbsp;&nbsp;
      <a href="#M000330">violated</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name"><a href="ModuleInclusionWarnings.html">ModuleInclusionWarnings</a></span>
        <span class="include-name"><a href="../Matchers.html">Matchers</a></span>
        <span class="include-name"><a href="Pending.html">Pending</a></span>
      </div>
    </div>

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000332" class="method-detail">
        <a name="M000332"></a>

        <div class="method-heading">
          <a href="#M000332" class="method-signature">
          <span class="method-name">__full_description</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000332-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000332-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_methods.rb, line 64</span>
64:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">__full_description</span>
65:         <span class="ruby-node">&quot;#{self.class.description} #{self.description}&quot;</span>
66:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000331" class="method-detail">
        <a name="M000331"></a>

        <div class="method-heading">
          <a href="#M000331" class="method-signature">
          <span class="method-name">description</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000331-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000331-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_methods.rb, line 60</span>
60:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">description</span>
61:         <span class="ruby-ivar">@_defined_description</span> <span class="ruby-operator">||</span> <span class="ruby-operator">::</span><span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Matchers</span>.<span class="ruby-identifier">generated_description</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;NO NAME&quot;</span>
62:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000334" class="method-detail">
        <a name="M000334"></a>

        <div class="method-heading">
          <a href="#M000334" class="method-signature">
          <span class="method-name">eval_block</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000334-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000334-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_methods.rb, line 77</span>
77:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">eval_block</span>
78:         <span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-ivar">@_implementation</span>)
79:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000328" class="method-detail">
        <a name="M000328"></a>

        <div class="method-heading">
          <a href="#M000328" class="method-signature">
          <span class="method-name">execute</span><span class="method-args">(options, instance_variables)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000328-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000328-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_methods.rb, line 8</span>
 8:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">execute</span>(<span class="ruby-identifier">options</span>, <span class="ruby-identifier">instance_variables</span>)
 9:         <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reporter</span>.<span class="ruby-identifier">example_started</span>(<span class="ruby-keyword kw">self</span>)
10:         <span class="ruby-identifier">set_instance_variables_from_hash</span>(<span class="ruby-identifier">instance_variables</span>)
11:         
12:         <span class="ruby-identifier">execution_error</span> = <span class="ruby-keyword kw">nil</span>
13:         <span class="ruby-constant">Timeout</span>.<span class="ruby-identifier">timeout</span>(<span class="ruby-identifier">options</span>.<span class="ruby-identifier">timeout</span>) <span class="ruby-keyword kw">do</span>
14:           <span class="ruby-keyword kw">begin</span>
15:             <span class="ruby-identifier">before_example</span>
16:             <span class="ruby-identifier">eval_block</span>
17:           <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
18:             <span class="ruby-identifier">execution_error</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">e</span>
19:           <span class="ruby-keyword kw">end</span>
20:           <span class="ruby-keyword kw">begin</span>
21:             <span class="ruby-identifier">after_example</span>
22:           <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
23:             <span class="ruby-identifier">execution_error</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">e</span>
24:           <span class="ruby-keyword kw">end</span>
25:         <span class="ruby-keyword kw">end</span>
26: 
27:         <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reporter</span>.<span class="ruby-identifier">example_finished</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">execution_error</span>)
28:         <span class="ruby-identifier">success</span> = <span class="ruby-identifier">execution_error</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-constant">ExamplePendingError</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">execution_error</span>
29:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000335" class="method-detail">
        <a name="M000335"></a>

        <div class="method-heading">
          <a href="#M000335" class="method-signature">
          <span class="method-name">implementation_backtrace</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000335-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000335-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_methods.rb, line 81</span>
81:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">implementation_backtrace</span>
82:         <span class="ruby-identifier">eval</span>(<span class="ruby-value str">&quot;caller&quot;</span>, <span class="ruby-ivar">@_implementation</span>)
83:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000329" class="method-detail">
        <a name="M000329"></a>

        <div class="method-heading">
          <a href="#M000329" class="method-signature">
          <span class="method-name">instance_variable_hash</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000329-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000329-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_methods.rb, line 31</span>
31:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_variable_hash</span>
32:         <span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">inject</span>({}) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">variable_hash</span>, <span class="ruby-identifier">variable_name</span><span class="ruby-operator">|</span>
33:           <span class="ruby-identifier">variable_hash</span>[<span class="ruby-identifier">variable_name</span>] = <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">variable_name</span>)
34:           <span class="ruby-identifier">variable_hash</span>
35:         <span class="ruby-keyword kw">end</span>
36:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000333" class="method-detail">
        <a name="M000333"></a>

        <div class="method-heading">
          <a href="#M000333" class="method-signature">
          <span class="method-name">set_instance_variables_from_hash</span><span class="method-args">(ivars)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000333-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000333-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_methods.rb, line 68</span>
68:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_instance_variables_from_hash</span>(<span class="ruby-identifier">ivars</span>)
69:         <span class="ruby-identifier">ivars</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">variable_name</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
70:           <span class="ruby-comment cmt"># Ruby 1.9 requires variable.to_s on the next line</span>
71:           <span class="ruby-keyword kw">unless</span> [<span class="ruby-value str">'@_implementation'</span>, <span class="ruby-value str">'@_defined_description'</span>, <span class="ruby-value str">'@_matcher_description'</span>, <span class="ruby-value str">'@method_name'</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">variable_name</span>.<span class="ruby-identifier">to_s</span>)
72:             <span class="ruby-identifier">instance_variable_set</span> <span class="ruby-identifier">variable_name</span>, <span class="ruby-identifier">value</span>
73:           <span class="ruby-keyword kw">end</span>
74:         <span class="ruby-keyword kw">end</span>
75:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000330" class="method-detail">
        <a name="M000330"></a>

        <div class="method-heading">
          <a href="#M000330" class="method-signature">
          <span class="method-name">violated</span><span class="method-args">(message=&quot;&quot;)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000330-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000330-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_methods.rb, line 38</span>
38:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">violated</span>(<span class="ruby-identifier">message</span>=<span class="ruby-value str">&quot;&quot;</span>)
39:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Expectations</span><span class="ruby-operator">::</span><span class="ruby-constant">ExpectationNotMetError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">message</span>)
40:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M000337" class="method-detail">
        <a name="M000337"></a>

        <div class="method-heading">
          <a href="#M000337" class="method-signature">
          <span class="method-name">after_example</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000337-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000337-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_methods.rb, line 94</span>
94:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">after_example</span>
95:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">run_after_each</span>(<span class="ruby-keyword kw">self</span>)
96:         <span class="ruby-identifier">verify_mocks_for_rspec</span>
97:       <span class="ruby-keyword kw">ensure</span>
98:         <span class="ruby-identifier">teardown_mocks_for_rspec</span>
99:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000336" class="method-detail">
        <a name="M000336"></a>

        <div class="method-heading">
          <a href="#M000336" class="method-signature">
          <span class="method-name">before_example</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000336-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000336-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/example_methods.rb, line 89</span>
89:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">before_example</span>
90:         <span class="ruby-identifier">setup_mocks_for_rspec</span>
91:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">run_before_each</span>(<span class="ruby-keyword kw">self</span>)
92:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>